package com.yeswater.multithread.chapter2.test2_1.test10;

import java.util.concurrent.TimeUnit;

/**
 * author : yeswater
 * date : 2023/10/20
 */

public class Main {

    synchronized public void serviceMethod() {
        try {
            System.out.println("int main 下一步 sleep begin threadName=" + Thread.currentThread().getName()
                    + " time=" + System.currentTimeMillis());
            TimeUnit.SECONDS.sleep(5);
            System.out.println("int main 下一步 sleep   end threadName=" + Thread.currentThread().getName()
                    + " time=" + System.currentTimeMillis());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
